#include <glib.h>

static void test_glib_spawning_proc_sync_simple(void)
{
    gboolean ret = FALSE;
    gchar *standard_output;
    gchar *standard_error;
    gint estatus;
    GError *error = NULL;

    ret = g_spawn_command_line_sync("/bin/ls -a -l . file_not_exist", &standard_output, &standard_error, &estatus, &error);
    if(FALSE == ret) {
        g_print("g_spawn_command_line_sync error! \n");
        return;
    }

    g_print("%s \n", standard_output);
    g_print("%s \n", standard_error);

    g_free(standard_output);
    g_free(standard_error);

    return;
}

gint main(gint argc, gchar **argv) 
{
    test_glib_spawning_proc_sync_simple();

    return 0;
}
